﻿/*
#------------------------------------------------------------------------------
#-- Program Name:	[dbo].[fnMSX_get_sql_edition]
#-- Purpose:		Convert the integer value to a text value; based on BOL
#--	Last Update:	07/31/2012
#--					For a complete history - please review comments in Version
#--					Control.
#------------------------------------------------------------------------------
*/
CREATE FUNCTION [dbo].[fnMSX_get_sql_edition]
(
	@edition_id			int
)
RETURNS varchar(30)
AS
BEGIN
	RETURN	(CASE @edition_id 
				WHEN -1253826760 THEN 'Desktop'
				WHEN -1592396055 THEN 'Express'
				WHEN -1534726760 THEN 'Standard'
				WHEN 1333529388 THEN 'Workgroup'
				WHEN 1804890536 THEN 'Enterprise'
				WHEN 1872460670 THEN 'Enterprise: Core-based Licensing'
				WHEN -323382091 THEN 'Personal'
				WHEN -2117995310 THEN 'Developer'
				WHEN 610778273 THEN 'Enterprise Evaluation'
				WHEN 1044790755 THEN 'Windows Embedded SQL'
				WHEN 4161255391 THEN 'Express with Advanced Services'
				ELSE 'Unknown'
			END)
END
